﻿using System;
using NHibernate;
using NHibernate.Cfg;
using NHibernate.Tool.hbm2ddl;
using NUnit.Framework;
using OurSite.Business.Picture;
using OurSite.Business.Repositories;


namespace OurSite.Tests
{
    [TestFixture]
    public class PictureRepository_Fixture
    {
        Guid g = new Guid("B794DF14-C065-46D6-9D3B-6DB05F58053A");

        [TestFixtureSetUp]
        public void TestFixtureSetUp()
        {
            NHibernateSessionManager.Instance.Initialize();
        }

        [Test]
        public void Can_get_Picture_by_EventID()
        {
            IPictureRepository repository = new PictureRepository();
            var images = repository.GetByEventID(g);

            Assert.Greater(images.Count, 10);
        }

        [Test]
        public void Can_get_Next_PictureCode()
        {
            IPictureRepository repository = new PictureRepository();
            var pictureCode = repository.GetNextPictureCode();

            Assert.Greater(pictureCode, 0);
        }


    }
}
